<script lang="ts" setup>

const {money} = defineProps<{
    money: number
}>();
const BankCount = ref(0);
const BagCount = ref(0);
const Purse = ref(false);
const CoinCount = ref(0);
watch(() => money, (value: number) => {
    BankCount.value = Math.floor(value / 100);
    BagCount.value = Math.floor((value % 100) / 10);
    Purse.value = value % 10 >= 5;
    CoinCount.value = Math.floor(value % 5);
}, {immediate: true});
</script>

<template>
    <template v-for="item in BankCount" :key="item">🏦</template>
    <template v-for="item in BagCount" :key="item">💰</template>
    <template v-if="Purse">👛</template>
    <template v-for="item in CoinCount" :key="item">🪙</template>
</template>